<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('infoclass_update'); 
$cid = isset($cid) ? $cid : '';
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>编辑类别</title>
<link href="templates/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="templates/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/jquery.nicescroll.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/laymain.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/common.js"></script>
<script type="text/javascript" src="templates/js/getuploadify.js"></script>
<script src="../plugin/artDialog/artDialog.js?skin=simple"></script>
<script src="../plugin/artDialog/plugins/iframeTools.js"></script>
<script type="text/javascript">
     $(function () {
        //初始化表单验证
        $("#form").initValidform();
    });
</script>
</head>

<body class="mainbody">
<?php
$row = $dosql->GetOne("SELECT * FROM `#@__infoclass` WHERE `id`=$id");
?>
<form method="post" action="infoclass_save.php" id="form">
<!--导航栏-->

<div class="location">
  <a href="infoclass.php" class="back"><i></i><span>返回列表页</span></a>
  <a href="home.php" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <a href="infoclass.php"><span>栏目类别</span></a>
  <i class="arrow"></i>
  <span>编辑栏目</span>
    <a href="javascript:location.reload();" class="reload">刷新</a>
</div>
<div class="line10"></div>
<!--/导航栏-->

<!--内容-->
<div id="floatHead" class="content-tab-wrap">
  <div class="content-tab">
    <div class="content-tab-ul-wrap">
      <ul>
        <li><a class="selected" href="javascript:;">基本信息</a></li>
        <li><a href="javascript:;">扩展选项</a></li>
      </ul>
    </div>
  </div>
</div>

<div class="tab-content">
  <dl>
    <dt>栏目类型</dt>
    <dd>
      <div class="rule-single-select">
     
			<select name="infotype" id="infotype">
				<?php
				foreach(array('0'=>'单页','1'=>'列表','4'=>'商品') as $k => $v)
				{
					if($row['infotype'] == $k)
						$selected = 'selected="selected"';
					else
						$selected = '';

					echo "<option value=\"$k\" $selected>$v</option>";
				}
				
				//循环自定义模型
				$dosql->Execute("SELECT * FROM `#@__diymodel` ORDER BY id ASC");
				while($row2 = $dosql->GetArray())
				{
					if($row['infotype'] == $row2['id'])
						$selected = 'selected="selected"';
					else
						$selected = '';
					
					echo "<option value=\"".$row2['id']."\" $selected>".$row2['modeltitle']."</option>";
				}
				?>
				</select>
      </div>
    </dd>
  </dl>
   <dl>
    <dt>所属栏目：</dt>
    <dd>
      <div class="rule-single-select">
			<select name="parentid" id="parentid" onchange="GetCatpSize(this.value);">
					<option value="0">一级栏目</option>
					<?php GetAllType('#@__infoclass','#@__infoclass','parentid'); ?>
				</select>
      </div>
    </dd>
  </dl>

  <dl>
    <dt>栏目名称</dt>
    <dd><input name="classname" type="text" value="<?php echo $row['classname']; ?>" id="classname" class="input normal" datatype="*1-100" sucmsg=" " /> <span class="Validform_checktip">栏目名称，100字符内</span></dd>
  </dl>
  <dl>
    <dt>SEO标题</dt>
    <dd>
      <input name="seotitle" type="text" maxlength="255" id="seotitle" value="<?php echo $row['seotitle']; ?>" class="input normal" datatype="s0-100" sucmsg=" " />
      <span class="Validform_checktip">255个字符以内</span>
    </dd>
  </dl>
  <dl>
    <dt>SEO关健字</dt>
    <dd>
     <input type="text" name="keywords" id="keywords" class="input normal" value="<?php echo $row['keywords']; ?>" />
      <span class="Validform_checktip">以“,”逗号区分开，255个字符以内</span>
    </dd>
  </dl>
  <dl>
    <dt>SEO描述</dt>
    <dd><textarea name="description" id="description"  rows="2" cols="20" class="input"><?php echo $row['description']; ?></textarea>
     
      <span class="Validform_checktip">255个字符以内</span>
    </dd>
  </dl>
    <dl>
    <dt>排序数字</dt>
    <dd>
      <input name="orderid" type="text" value="<?php echo $row['orderid']; ?>" id="orderid" class="input small" datatype="n" sucmsg=" " />
      <span class="Validform_checktip">*数字，越小越向前</span>
    </dd>
  </dl>
  <dl>
    <dt>是否启用</dt>
    <dd>
      <div class="rule-single-checkbox">
          <input id="checkinfo" type="checkbox" value="true" name="checkinfo" <?php if($row['checkinfo'] != 'false') echo 'checked="checked"'; ?>  />
      </div>
      <span class="Validform_checktip">*隐藏后不显示在界面导航菜单中。</span>
    </dd>
  </dl>
</div>

<div class="tab-content" style="display:none">
  <dl>
    <dt>URL链接</dt>
    <dd>
      <input name="linkurl" type="text" maxlength="255" id="linkurl" value="<?php echo $row['linkurl']; ?>"  class="input normal" />
      <span class="Validform_checktip">填写后直接跳转到该网址</span>
    </dd>
  </dl>
 <dl>
    <dt>缩略图片</dt>
    <dd>
    <input name="picurl" type="text" id="picurl" class="input normal" value="<?php echo $row['picurl']; ?>" />
	<div class="upload-box upload-img">
	<div class="webuploader-pick"  onmousemove="this.className='webuploader-pick webuploader-pick-hover'" onmouseout="this.className='webuploader-pick'" onclick="GetUploadify('uploadify','缩略图上传','image','image',1,<?php echo $cfg_max_file_size; ?>,'picurl')">浏览...</div> 
	</div>
    </dd>
  </dl> 
  <dl>
    <dt>自动缩略</dt>
    <dd>
   <input type="text" name="picwidth" id="picwidth" class="input small" value="<?php echo $row['picwidth']; ?>" />&nbsp;宽度(px)
				&nbsp;&nbsp;&nbsp;
	<input type="text" name="picheight" id="picheight" class="input small" value="<?php echo $row['picheight']; ?>" />&nbsp;高度(px)
   <span class="Validform_checktip">子栏目自动获取上级尺寸；留空不启用；</span>
    </dd>
  </dl>
 <dl>
    <dt>属性资源</dt>
    <dd><div class="rule-multi-porp">
          <span id="flag">
		<?php
			$flagarr = explode(',',$row['flag']);
			$dosql->Execute("SELECT * FROM `#@__infoflag` ORDER BY orderid ASC");
			while($r = $dosql->GetArray())
			{
				echo '<input type="checkbox" name="flag[]" id="flag[]'.$r['flag'].'" value="'.$r['id'].'"';

				if(in_array($r['id'],$flagarr))
				{
					echo 'checked="checked"';
				}

				echo '/><label for="flag[]'.$r['flag'].'">'.$r['flagname'].'['.$r['flag'].']</label>';
			}
			?>
			</span></div>
	<span class="Validform_checktip"><a href="javascript:;" onclick="art.dialog.open('infoflag.php', {title: '信息标记管理', width: 650, height: 600});"  target="_self">添加新属性</a>   子栏目自动获取上级属性</span>
    </dd>
  </dl>
 

</div>
<!--/内容-->

<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
  	<input type="submit" class="btn" value="提交" />
		<input type="button" class="btn yellow" value="返回上一页" onclick="javascript:history.back(-1);" />
		<input type="hidden" name="action" id="action" value="update" />
		<input type="hidden" name="id" id="id" value="<?php echo $id; ?>" />
		<input type="hidden" name="cid" id="cid" value="<?php echo $cid; ?>" />
		<input type="hidden" name="repid" id="repid" value="<?php echo $row['parentid']; ?>" />
   
  </div>
</div>
<!--/工具栏-->

</form>
</body>
</html>
